﻿PROJECT = "hello world"
VERSION = "1.0.0"

sys = require("sys")

-- 控制台打印Hello World
log.info("---Hello World---")

-- 初始化显示屏
spi_lcd = spi.deviceSetup(2, 7, 0, 0, 8, 20000000, spi.MSB, 1, 1)
lcd.init("st7735s",{port = "device",pin_dc = 6, pin_rst = 10,direction = 4,w = 160,h = 80,xoffset = 0,yoffset = 24},spi_lcd)
lcd.invoff()

-- 初始化LVGL库
lvgl.init()
lvgl.disp_set_bg_color(nil, 0xFFFFFF)

-- 建立一个默认按钮，并显示标签内容
local scr = lvgl.obj_create(nil, nil)
local btn = lvgl.btn_create(scr)
lvgl.obj_align(btn, lvgl.scr_act(), lvgl.ALIGN_CENTER, 0, 0)
local label = lvgl.label_create(btn)
lvgl.label_set_text(label, "Hello World")
lvgl.scr_load(scr)

--启动Luat框架
sys.run()





























